﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace DisplayBoardInfo.Server.Forms.Board
{
    /// <summary>
    /// Interaction logic for doctorInfo.xaml
    /// </summary>
    public partial class DoctorInfo : UserControl
    {
        private Entities.User user;

        public DoctorInfo()
        {
            InitializeComponent();
        }

        public Entities.User User
        {
            get
            {
                return user;
            }

            set
            {
                this.user = value;
                UpdateView();
            }
        }

        private void UpdateView()
        {
            name.Content = this.user.Name;
            lastname.Content = this.user.LastName;
            title.Content = this.user.Position.ToUpper();
            if (this.user.Photo != null)
            {
                photo.Source = Helpers.Convert.ImageToBitmapImage(user.Photo);
            }
        }
    }
}
